package com.ruoyi.iptv.live.info.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.iptv.live.info.mapper.IptvLiveInfoMapper;
import com.ruoyi.iptv.live.info.domain.IptvLiveInfo;
import com.ruoyi.iptv.live.info.service.IIptvLiveInfoService;
import com.ruoyi.common.core.text.Convert;

/**
 * 直播频道Service业务层处理
 * 
 * @author 玉念聿辉
 * @date 2021-10-20
 */
@Service
public class IptvLiveInfoServiceImpl implements IIptvLiveInfoService 
{
    @Autowired
    private IptvLiveInfoMapper iptvLiveInfoMapper;

    /**
     * 查询直播频道
     * 
     * @param id 直播频道主键
     * @return 直播频道
     */
    @Override
    public IptvLiveInfo selectIptvLiveInfoById(Long id)
    {
        return iptvLiveInfoMapper.selectIptvLiveInfoById(id);
    }

    /**
     * 查询直播频道列表
     * 
     * @param iptvLiveInfo 直播频道
     * @return 直播频道
     */
    @Override
    public List<IptvLiveInfo> selectIptvLiveInfoList(IptvLiveInfo iptvLiveInfo)
    {
        return iptvLiveInfoMapper.selectIptvLiveInfoList(iptvLiveInfo);
    }

    /**
     * 新增直播频道
     * 
     * @param iptvLiveInfo 直播频道
     * @return 结果
     */
    @Override
    public int insertIptvLiveInfo(IptvLiveInfo iptvLiveInfo)
    {
        iptvLiveInfo.setCreateTime(DateUtils.getNowDate());
        return iptvLiveInfoMapper.insertIptvLiveInfo(iptvLiveInfo);
    }

    /**
     * 修改直播频道
     * 
     * @param iptvLiveInfo 直播频道
     * @return 结果
     */
    @Override
    public int updateIptvLiveInfo(IptvLiveInfo iptvLiveInfo)
    {
        iptvLiveInfo.setUpdateTime(DateUtils.getNowDate());
        return iptvLiveInfoMapper.updateIptvLiveInfo(iptvLiveInfo);
    }

    /**
     * 批量删除直播频道
     * 
     * @param ids 需要删除的直播频道主键
     * @return 结果
     */
    @Override
    public int deleteIptvLiveInfoByIds(String ids)
    {
        return iptvLiveInfoMapper.deleteIptvLiveInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除直播频道信息
     * 
     * @param id 直播频道主键
     * @return 结果
     */
    @Override
    public int deleteIptvLiveInfoById(Long id)
    {
        return iptvLiveInfoMapper.deleteIptvLiveInfoById(id);
    }
}
